package com.qiangqiang.task.server.util;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/**
 * @author : sky
 * @date : 2018/7/15
 * @description :
 */
public class TimeFormat {

    /**
     * @param [time] time: Long型的时间
     * @return java.lang.String
     * @author sky
     * @date 2018/7/15
     * @describe: 时间转换 Long --> String
     */
    public static String converTime(long time) {
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm");
        return dtf.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneId.systemDefault()));
    }
}
